/**
 * 角色管理相关接口
 */
import request from '@/utils/requestServe';



/**
 * 查询部门下的用户
 */
export const queryDeptUser = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/getUserPageList',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 删除或注销部门下的用户
 */
export const cancelUserByIds = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/cancelUserByIds',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 恢复部门下的用户
 */
export const recoverUserByIds = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/recoverUserByIds',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 新增部门下的用户
 */
export const addDeptUser = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/saveUser',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 查询用户信息
 */
export const querySingleDeptUser = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/getUserInfo',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 修改保存用户信息
 */
export const updateDeptUser = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/updateUser',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 重置员工密码
 */
export const resetUserPwdFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/resetUserPwd',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 锁定员工
 */
export const lockUserPwdFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/lockUserByIds',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 解锁员工
 */
export const unlockUserPwdFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/unlockUserByIds',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 角色管理模块 - 批量物理删除
 * @param {Object} data
 */
export const deleteUserByIds = (data) => {
    return request({
        url: '/api-sys/sys/user/deleteUserByIds',
        method: 'POST',
        data
    })
}
/**
 * 禁用员工
 */
export const cancelUserPwdFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/cancelUserByIds',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 导入员工
 */
export const importUserFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/importData',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 员工修改密码
 */
export const editUserPwdFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/updateBatchPwd',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 调整部门
 */
export const changeUserDept = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/updateUserDept',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 新增部门下的邮件地址刷新
 */
export const newEmailPath = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/getRandomNum',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 邮件发送邀请
 */
export const sendEmail = (data, tenementId) => {
    return request({
        url: '/api-sys/message/sendMsg',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 获取手机验证码
 */
export const getPhoneCode = (data, tenementId) => {
    return request({
        url: '/api-sys/message/sms/sendCode',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 验证手机验证码
 */
export const checkPhoneCode = (data, tenementId) => {
    return request({
        url: '/api-sys/message/sms/checkCode',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 密码修改
 */
export const changePassword = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/updatePwd',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 获取验证码图片
 */
export const getloginCodeImageFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/loginCodeImage',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 验证验证码
 */
export const checkLoginCodeFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/checkLoginCode',
        method: 'post',
        tenementId: tenementId,
        data
    })
}

/**
 * 登录日志
 */
export const queryLoginLogFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/longLog/es/mustPageQuery',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 操作日志
 */
export const queryOperateLogFun = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/methods/es/mustPageQuery',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
/**
 * 绑定邮箱
 */
export const bindingMail = (data, tenementId) => {
    return request({
        url: '/api-sys/sys/user/sendBindMail',
        method: 'post',
        tenementId: tenementId,
        data
    })
}
